package com.lei.springbootpractice.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Set; // 导入 Set

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value="Orders")
public class OrdersPojo {
    @TableId(value="order_id",type= IdType.ASSIGN_ID)
    private String orderId;
    //TODO:两个外键..
    @TableField(value="address_id")
    private String addressId;
    @TableField(value="user_id")
    private String userId;

    @TableField(value="status")
    private String status;
    @TableField(value="payment_type")
    private String paymentType;
    @TableField(value="payment_account")
    private String paymentAccount;
    @TableField(value = "totalPrice")
    private double totalPrice;
    //TODO:用哪种数据类型表达日期？
    @TableField(value="date")
    private String date;
    @TableField(value="shippingCompany")
    private String shippingCompany;
    @TableField(value = "shippingNo")
    private String shippingNo;


    // 关联的地址信息 (不映射到数据库字段)
    @TableField(exist = false)
    private AddressPojo address;

    // 关联的商品捆绑信息 (不映射到数据库字段)
    @TableField(exist = false)
    private List<ProductBunchPojo> productBunches;

    // 新增字段：已评价的商品ID集合 (不映射到数据库字段)
    @TableField(exist = false)
    private Set<String> reviewedProductIds;





}
